3.1 \(\int (a+b x) (c+d x) (e+f x) (g+h x) \, dx\)

Optimal. Leaf size=112 \[ \frac{1}{4} x^4 (a d f h+b (c f h+d e h+d f g))+\frac{1}{3} x^3 (a (c f h+d e h+d f g)+b (c e h+c f g+d e g))+\frac{1}{2} x^2 (a (c e h+c f g+d e g)+b c e g)+a c e g x+\frac{1}{5} b d f h x^5 \]

[Out]

a*c*e*g*x + ((b*c*e*g + a*(d*e*g + c*f*g + c*e*h))*x^2)/2 + ((b*(d*e*g + c*f*g + c*e*h) + a*(d*f*g + d*e*h + c
*f*h))*x^3)/3 + ((a*d*f*h + b*(d*f*g + d*e*h + c*f*h))*x^4)/4 + (b*d*f*h*x^5)/5

________________________________________________________________________________________

Rubi [A]  time = 0.157949, antiderivative size = 112, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 1, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.048, Rules used = {142} \[ \frac{1}{4} x^4 (a d f h+b (c f h+d e h+d f g))+\frac{1}{3} x^3 (a (c f h+d e h+d f g)+b (c e h+c f g+d e g))+\frac{1}{2} x^2 (a (c e h+c f g+d e g)+b c e g)+a c e g x+\frac{1}{5} b d f h x^5 \]

Antiderivative was successfully verified.

[In]

Int[(a + b*x)*(c + d*x)*(e + f*x)*(g + h*x),x]

[Out]

a*c*e*g*x + ((b*c*e*g + a*(d*e*g + c*f*g + c*e*h))*x^2)/2 + ((b*(d*e*g + c*f*g + c*e*h) + a*(d*f*g + d*e*h + c
*f*h))*x^3)/3 + ((a*d*f*h + b*(d*f*g + d*e*h + c*f*h))*x^4)/4 + (b*d*f*h*x^5)/5

Rule 142

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_) + (f_.)*(x_))*((g_.) + (h_.)*(x_)), x_Symbol]
:> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)*(g + h*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, h},
x] && (IGtQ[m, 0] || IntegersQ[m, n])

Rubi steps

\begin{align*} \int (a+b x) (c+d x) (e+f x) (g+h x) \, dx &=\int \left (a c e g+(b c e g+a (d e g+c f g+c e h)) x+(b (d e g+c f g+c e h)+a (d f g+d e h+c f h)) x^2+(a d f h+b (d f g+d e h+c f h)) x^3+b d f h x^4\right ) \, dx\\ &=a c e g x+\frac{1}{2} (b c e g+a (d e g+c f g+c e h)) x^2+\frac{1}{3} (b (d e g+c f g+c e h)+a (d f g+d e h+c f h)) x^3+\frac{1}{4} (a d f h+b (d f g+d e h+c f h)) x^4+\frac{1}{5} b d f h x^5\\ \end{align*}

Mathematica [A]  time = 0.0493336, size = 112, normalized size = 1. \[ \frac{1}{4} x^4 (a d f h+b c f h+b d e h+b d f g)+\frac{1}{3} x^3 (a c f h+a d e h+a d f g+b c e h+b c f g+b d e g)+\frac{1}{2} x^2 (a c e h+a c f g+a d e g+b c e g)+a c e g x+\frac{1}{5} b d f h x^5 \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*x)*(c + d*x)*(e + f*x)*(g + h*x),x]

[Out]

a*c*e*g*x + ((b*c*e*g + a*d*e*g + a*c*f*g + a*c*e*h)*x^2)/2 + ((b*d*e*g + b*c*f*g + a*d*f*g + b*c*e*h + a*d*e*
h + a*c*f*h)*x^3)/3 + ((b*d*f*g + b*d*e*h + b*c*f*h + a*d*f*h)*x^4)/4 + (b*d*f*h*x^5)/5

________________________________________________________________________________________

Maple [A]  time = 0.002, size = 109, normalized size = 1. \begin{align*}{\frac{bdfh{x}^{5}}{5}}+{\frac{ \left ( \left ( \left ( ad+bc \right ) f+bde \right ) h+bdfg \right ){x}^{4}}{4}}+{\frac{ \left ( \left ( acf+ \left ( ad+bc \right ) e \right ) h+ \left ( \left ( ad+bc \right ) f+bde \right ) g \right ){x}^{3}}{3}}+{\frac{ \left ( aceh+ \left ( acf+ \left ( ad+bc \right ) e \right ) g \right ){x}^{2}}{2}}+acegx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x+a)*(d*x+c)*(f*x+e)*(h*x+g),x)

[Out]

1/5*b*d*f*h*x^5+1/4*(((a*d+b*c)*f+b*d*e)*h+b*d*f*g)*x^4+1/3*((a*c*f+(a*d+b*c)*e)*h+((a*d+b*c)*f+b*d*e)*g)*x^3+
1/2*(a*c*e*h+(a*c*f+(a*d+b*c)*e)*g)*x^2+a*c*e*g*x

________________________________________________________________________________________

Maxima [A]  time = 1.14432, size = 146, normalized size = 1.3 \begin{align*} \frac{1}{5} \, b d f h x^{5} + a c e g x + \frac{1}{4} \,{\left (b d f g +{\left (b d e +{\left (b c + a d\right )} f\right )} h\right )} x^{4} + \frac{1}{3} \,{\left ({\left (b d e +{\left (b c + a d\right )} f\right )} g +{\left (a c f +{\left (b c + a d\right )} e\right )} h\right )} x^{3} + \frac{1}{2} \,{\left (a c e h +{\left (a c f +{\left (b c + a d\right )} e\right )} g\right )} x^{2} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)*(d*x+c)*(f*x+e)*(h*x+g),x, algorithm="maxima")

[Out]

1/5*b*d*f*h*x^5 + a*c*e*g*x + 1/4*(b*d*f*g + (b*d*e + (b*c + a*d)*f)*h)*x^4 + 1/3*((b*d*e + (b*c + a*d)*f)*g +
 (a*c*f + (b*c + a*d)*e)*h)*x^3 + 1/2*(a*c*e*h + (a*c*f + (b*c + a*d)*e)*g)*x^2

________________________________________________________________________________________

Fricas [A]  time = 1.08041, size = 379, normalized size = 3.38 \begin{align*} \frac{1}{5} x^{5} h f d b + \frac{1}{4} x^{4} g f d b + \frac{1}{4} x^{4} h e d b + \frac{1}{4} x^{4} h f c b + \frac{1}{4} x^{4} h f d a + \frac{1}{3} x^{3} g e d b + \frac{1}{3} x^{3} g f c b + \frac{1}{3} x^{3} h e c b + \frac{1}{3} x^{3} g f d a + \frac{1}{3} x^{3} h e d a + \frac{1}{3} x^{3} h f c a + \frac{1}{2} x^{2} g e c b + \frac{1}{2} x^{2} g e d a + \frac{1}{2} x^{2} g f c a + \frac{1}{2} x^{2} h e c a + x g e c a \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)*(d*x+c)*(f*x+e)*(h*x+g),x, algorithm="fricas")

[Out]

1/5*x^5*h*f*d*b + 1/4*x^4*g*f*d*b + 1/4*x^4*h*e*d*b + 1/4*x^4*h*f*c*b + 1/4*x^4*h*f*d*a + 1/3*x^3*g*e*d*b + 1/
3*x^3*g*f*c*b + 1/3*x^3*h*e*c*b + 1/3*x^3*g*f*d*a + 1/3*x^3*h*e*d*a + 1/3*x^3*h*f*c*a + 1/2*x^2*g*e*c*b + 1/2*
x^2*g*e*d*a + 1/2*x^2*g*f*c*a + 1/2*x^2*h*e*c*a + x*g*e*c*a

________________________________________________________________________________________

Sympy [A]  time = 0.074263, size = 148, normalized size = 1.32 \begin{align*} a c e g x + \frac{b d f h x^{5}}{5} + x^{4} \left (\frac{a d f h}{4} + \frac{b c f h}{4} + \frac{b d e h}{4} + \frac{b d f g}{4}\right ) + x^{3} \left (\frac{a c f h}{3} + \frac{a d e h}{3} + \frac{a d f g}{3} + \frac{b c e h}{3} + \frac{b c f g}{3} + \frac{b d e g}{3}\right ) + x^{2} \left (\frac{a c e h}{2} + \frac{a c f g}{2} + \frac{a d e g}{2} + \frac{b c e g}{2}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)*(d*x+c)*(f*x+e)*(h*x+g),x)

[Out]

a*c*e*g*x + b*d*f*h*x**5/5 + x**4*(a*d*f*h/4 + b*c*f*h/4 + b*d*e*h/4 + b*d*f*g/4) + x**3*(a*c*f*h/3 + a*d*e*h/
3 + a*d*f*g/3 + b*c*e*h/3 + b*c*f*g/3 + b*d*e*g/3) + x**2*(a*c*e*h/2 + a*c*f*g/2 + a*d*e*g/2 + b*c*e*g/2)

________________________________________________________________________________________

Giac [A]  time = 1.41033, size = 203, normalized size = 1.81 \begin{align*} \frac{1}{5} \, b d f h x^{5} + \frac{1}{4} \, b d f g x^{4} + \frac{1}{4} \, b c f h x^{4} + \frac{1}{4} \, a d f h x^{4} + \frac{1}{4} \, b d h x^{4} e + \frac{1}{3} \, b c f g x^{3} + \frac{1}{3} \, a d f g x^{3} + \frac{1}{3} \, a c f h x^{3} + \frac{1}{3} \, b d g x^{3} e + \frac{1}{3} \, b c h x^{3} e + \frac{1}{3} \, a d h x^{3} e + \frac{1}{2} \, a c f g x^{2} + \frac{1}{2} \, b c g x^{2} e + \frac{1}{2} \, a d g x^{2} e + \frac{1}{2} \, a c h x^{2} e + a c g x e \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)*(d*x+c)*(f*x+e)*(h*x+g),x, algorithm="giac")

[Out]

1/5*b*d*f*h*x^5 + 1/4*b*d*f*g*x^4 + 1/4*b*c*f*h*x^4 + 1/4*a*d*f*h*x^4 + 1/4*b*d*h*x^4*e + 1/3*b*c*f*g*x^3 + 1/
3*a*d*f*g*x^3 + 1/3*a*c*f*h*x^3 + 1/3*b*d*g*x^3*e + 1/3*b*c*h*x^3*e + 1/3*a*d*h*x^3*e + 1/2*a*c*f*g*x^2 + 1/2*
b*c*g*x^2*e + 1/2*a*d*g*x^2*e + 1/2*a*c*h*x^2*e + a*c*g*x*e